package com.heima.apis.fallback;

import com.heima.apis.client.IWemediaClient;
import com.heima.model.common.dtos.ResponseResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class IWemediaClientFallback implements FallbackFactory<IWemediaClient> {

    @Override
    public IWemediaClient create(Throwable throwable) {
        return new IWemediaClient() {
            @Override
            public ResponseResult listChannel() {
                log.info("openfeign查询频道失败");
                return ResponseResult.errorResult(500, "查询频道失败");
            }
        };
    }
}
